package com.swlz.servlet.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.swlz.dao.MallProductDAO;
import com.swlz.dao.MallTypeDAO;
import com.swlz.entity.MallType;
import com.swlz.service.MallProductService;
import com.swlz.service.MallTypeService;
import com.swlz.service.WebFileService;
import com.swlz.service.impl.MallProductServiceImpl;
import com.swlz.service.impl.MallTypeServiceImpl;
import com.swlz.service.impl.WebFileServiceForGoFastDFS;

@WebServlet("/admin/malltype.let")
public class TypeServlet extends HttpServlet{
	protected Logger log = LoggerFactory.getLogger(this.getClass());

	private WebFileService webFileService = new WebFileServiceForGoFastDFS();

	private MallTypeService malltypeService =new MallTypeServiceImpl();
	private MallProductService mallProductService=new MallProductServiceImpl();
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	log.debug( malltypeService.list().toString()+"==================");
		request.setAttribute("malltypeList", malltypeService.list());
		
		request.getRequestDispatcher("/admin/product/addProduct.jsp").forward(request, response);
	}
}
